﻿
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[CreateAssetMenu(fileName = "Health Potion", menuName = "Items/Potions/HP", order = 1)]
public class CommonHealthPotion : Item, IUsable
{
    [SerializeField]
    int minHP = 4;
    [SerializeField]
    int maxHP = 10;
    
    public void use()
    {
        
        ItemDelete();
        int hpRec = Random.Range(minHP, maxHP);
        
        if (hpRec >= 0)
        {
            Player.MyInstance.GetHealth(hpRec);
        }
        else
        {
            hpRec = -hpRec;
            Player.MyInstance.ReceiveDMG(hpRec,Player.MyInstance.transform);
        }
        
    }
    public override string Description()
    {
        return base.Description()+string.Format("\nRestores {0} to {1}",minHP,maxHP);
    }

}
